package com.zonerobotics.zBotAPI.ZBot;

import com.zonerobotics.zBotAPI.Enums.EzReadVars;
import com.zonerobotics.zBotAPI.Enums.EzWriteVars;
import com.zonerobotics.zBotAPI.Listeners.IBotListener;
import com.zonerobotics.zBotAPI.ZMsg.ZImage;
import com.zonerobotics.zBotAPI.ZMsg.ZJoy;


public interface IZBot {

	public abstract void setBotEventListener(IBotListener ibl);

	/**
	 * this returns true if the poll service thinks that the bot is 
	 * ready
	 * @return
	 */
	public abstract boolean botReady();

	/**
	 * This sets a bot value, the value will be updated as the next
	 * packet goes out. If the value is the same as the previous no 
	 * update is made
	 * @param name
	 * enum which has tostring returing name key of value
	 * @param newValue
	 * new value to stick into hashmap
	 * @return
	 * returns the bot we are working on
	 */
	public abstract IZBot setValue(EzWriteVars name, Integer newValue);

	/**
	 * this returns the value from the bot using the name
	 * all values are returned as integers
	 * @param name
	 * enum value that tostring will return the name in the hashmap
	 * @return
	 * current integer value in hashmap, which should be value on bot
	 */
	public abstract Integer getValue(EzReadVars name);

	
	/**
	 * This causes the bot to react to a new joystick change this could
	 * be user generated or program generated. It is assumed that it will come
	 * from a gui object where somone has created a joystick. If the bot can it will
	 * move related to the the axes and turn stuff on/off related to the buttons
	 * @param joy
	 */
	public abstract void onJoyChange(ZJoy joy);
	
	/**
	 * This will kill the polling service and its threads. After this the bot is 
	 * nothing go ahead and remove it you will need to start another.
	 */
	public abstract void killBot();

	public abstract ZBotStats getStats();
	
	public ZImage getImageA();
	public ZImage getImageB();

}